package com.dzl.enterprise;

import com.dzl.base.controller.BaseController;
import com.dzl.enterprise.pojo.vo.WelfareEnterpriseVo;
import com.dzl.enterprise.service.WelfareEnterpriseService;
import com.dzl.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 企业基础信息(WelfareEnterprise)表控制层
 * @author caobucao
 * @date 2021-09-08 09:48:21
 */
@RestController
@RequestMapping("/welfareEnterprise")
public class WelfareEnterpriseController extends BaseController {

    @Autowired
    private WelfareEnterpriseService service;

    /**
     * 获取登录用户的企业信息
     * @date 2021/9/8 9:51
     * @author caobucao
     * @return com.dzl.util.JsonResult<com.dzl.enterprise.pojo.vo.WelfareEnterpriseVo>
     */
    @GetMapping("/getEnterpriseInfo")
    public JsonResult<WelfareEnterpriseVo> getEnterpriseInfo() {
        Integer enterpriseId = getAdminInfo().getEnterpriseId();
        return JsonResult.success(service.selectWelfareEnterpriseById(enterpriseId));
    }

}
